package cc.rengu.igas.bomp.facade.enums;

/**
 * @author: zhangxuran
 * @Date: 2020/4/3 15:23
 * @Description: 图片文件上传下载操作类型
 */
public enum BompImageFileOprTypeEnum {


    UPLOAD("00", "图片文件上传"),
    DOWNLOAD("01", "图片文件下载"),
    UPLOAD_SERVER_AND_UPLOAD_ALI("02", "图片文件上传同时上传支付宝"),
    TO_UPLOAD_ALI("12", "已有图片文件再上传支付宝"),
    UPLOAD_SERVER_AND_UPLOAD_WECHAT("03", "图片文件上传同时上传微信"),
    TO_UPLOAD_WECHAT("13", "已有图片文件再上传微信"),
    ;


    private String type;

    private String desc;

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    BompImageFileOprTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }


    public static BompImageFileOprTypeEnum getBompImageFileOprTypeByType(String type) {
        if (null == type || "".equals(type)) {
            return null;
        }

        for (BompImageFileOprTypeEnum bompImageFileOprTypeEnum : BompImageFileOprTypeEnum.values()) {
            if (bompImageFileOprTypeEnum.getType().equals(type)) {
                return bompImageFileOprTypeEnum;
            }
        }
        return null;
    }
}
